import React, { Component } from 'react';
import { Row, Col, } from 'antd';

import './CardTop.less';

import Card from './Card';

export default class CardTop extends Component {
  constructor(props) {
    super(props);
    this.state = {
        data:this.props.data
    };
  }

  render() {
    return (
        <div className="wrap-recommend">
          <Row className="row-title">
            <Col span={24}>
              <h5>官方精选</h5>
            </Col>
          </Row>
          <Row className="row-product">{
            this.state.data.map(function (val,index) {
                return  <Col span={6} key={index}>
                            <Card icon={val.icon}
                                  title={val.title}
                                  company={val.company}
                                  price={val.price}
                                  before_price={val.before_price}
                                  description={val.description}
                                  isdiscount={val.isdiscount}
                                  discount={val.discount}/>
                        </Col>
            })}
            <div className="pro_more">
              <div>
                <p>更多 &gt;</p>
              </div>
            </div>
          </Row>
        </div>
    );
  }
}